<?php
$first_id = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品管理',
    'router'      => '',
    'icon'        => 'layui-icon-diamond',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => '',
    'action'      => '',
    'create_time' => time()
]);

$first_id_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品分类',
    'parent_id'   => $first_id,
    'router'      => "{$mg_module}/StoreCategory/index",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'StoreCategory',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => 'layui-btn-sm'
]);

$first_id_1_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '添加分类',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/StoreCategory/add",
    'icon'        => 'layui-icon-add-1',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'StoreCategory',
    'action'      => 'add',
    'create_time' => time(),
    'style'       => 'layui-btn-sm layui-btn-normal'
]);

$first_id_2_2 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '编辑分类',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/StoreCategory/edit",
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'StoreCategory',
    'action'      => 'edit',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_2 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '删除分类',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/StoreCategory/del",
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'StoreCategory',
    'action'      => 'del',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger'
]);

$first_id_3 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '切换显示',
    'parent_id'   => $first_id_1,
    'router'      => "{$mg_module}/StoreCategory/is_show",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'StoreCategory',
    'action'      => 'is_show',
    'create_time' => time(),
    'style'       => ''
]);


$first_id_4 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品规格',
    'parent_id'   => $first_id,
    'router'      => "{$mg_module}/ProductRule/index",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'ProductRule',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => ''
]);

$first_id_4_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '添加商品规格',
    'parent_id'   => $first_id_4,
    'router'      => "{$mg_module}/ProductRule/add",
    'icon'        => 'layui-icon-add-1',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'ProductRule',
    'action'      => 'add',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_5 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '编辑商品规格',
    'parent_id'   => $first_id_4,
    'router'      => "{$mg_module}/ProductRule/edit",
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'ProductRule',
    'action'      => 'edit',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_5 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '删除商品规格',
    'parent_id'   => $first_id_4,
    'router'      => "{$mg_module}/ProductRule/del",
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'ProductRule',
    'action'      => 'del',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger'
]);

$first_id_5 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '规格解析',
    'parent_id'   => $first_id_4,
    'router'      => "{$mg_module}/ProductRule/read",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'ProductRule',
    'action'      => 'read',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_6 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品列表',
    'parent_id'   => $first_id,
    'router'      => "{$mg_module}/Goods/index",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => ''
]);

$first_id_7 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '添加商品',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/add",
    'icon'        => 'layui-icon-addition',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'add',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);


$first_id_7_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '商品设置热门',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/is_hot",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'is_hot',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_8 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '编辑商品',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/edit",
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'edit',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal'
]);

$first_id_9 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '删除商品',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/del",
    'icon'        => 'layui-icon-del',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'del',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger'
]);

$first_id_10 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '获取商品规格',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/get_rule",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'get_rule',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_11 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '生成商品规格属性',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/is_format_attr",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'is_format_attr',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_12 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '获取商品详情',
    'parent_id'   => $first_id_6,
    'router'      => "{$mg_module}/Goods/get_product_info",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Goods',
    'action'      => 'get_product_info',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_13 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单管理',
    'parent_id'   => 0,
    'router'      => '',
    'icon'        => 'layui-icon-form',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => '',
    'action'      => '',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_14 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单列表',
    'parent_id'   => $first_id_13,
    'router'      => "{$mg_module}/Order/index",
    'icon'        => 'layui-icon-form',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_15_1 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单详情',
    'parent_id'   => $first_id_14,
    'router'      => "{$mg_module}/Order/detail",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'detail',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_15 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单操作记录',
    'parent_id'   => $first_id_14,
    'router'      => "{$mg_module}/Order/order_log",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'order_log',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_16 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单编辑',
    'parent_id'   => $first_id_14,
    'router'      => "{$mg_module}/Order/eidt",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'eidt',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_17 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单发货',
    'parent_id'   => $first_id_14,
    'router'      => "{$mg_module}/Order/deliver",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'deliver',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_18 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '订单物流信息',
    'parent_id'   => $first_id_14,
    'router'      => "{$mg_module}/Order/distribution",
    'icon'        => '',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => 'Order',
    'action'      => 'distribution',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);




$first_id_20 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '营销活动',
    'router'      => '',
    'icon'        => 'layui-icon-fire',
    'status'      => 1,
    'sort'        => 99,
    'module'      => $mg_module,
    'controller'  => '',
    'action'      => '',
    'create_time' => time()
]);

$first_id_21 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券',
    'parent_id'   => $first_id_20,
    'router'      => '',
    'icon'        => '',
    'status'      => 1,
    'sort'        => 90,
    'module'      => $mg_module,
    'controller'  => '',
    'action'      => '',
    'create_time' => time()
]);

$first_id_22 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券模板',
    'parent_id'   => $first_id_21,
    'router'      => 'admin/CouponTemplate/index',
    'icon'        => '',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => 'layui-btn-xs'
]);

$first_id_23 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券模板添加',
    'parent_id'   => $first_id_22,
    'router'      => 'admin/CouponTemplate/create',
    'icon'        => 'layui-icon-addition',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'create',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal',
    'is_show'     => 0
]);

$first_id_24 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券模板编辑',
    'parent_id'   => $first_id_22,
    'router'      => 'admin/CouponTemplate/edit',
    'icon'        => 'layui-icon-edit',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'edit',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal',
    'is_show'     => 0
]);

$first_id_25 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券模板删除',
    'parent_id'   => $first_id_22,
    'router'      => 'admin/CouponTemplate/delete',
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'delete',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger',
    'is_show'     => 0
]);

$first_id_26 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券发布',
    'parent_id'   => $first_id_22,
    'router'      => 'admin/CouponTemplate/issue',
    'icon'        => 'layui-icon-share',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'issue',
    'create_time' => time(),
    'style'       => 'layui-btn-xs',
    'is_show'     => 0
]);

$first_id_27 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券列表',
    'parent_id'   => $first_id_21,
    'router'      => 'admin/Coupon/index',
    'icon'        => '',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'CouponTemplate',
    'action'      => 'index',
    'create_time' => time(),
    'style'       => 'layui-btn-xs',
    'is_show'     => 1
]);

$first_id_28 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '领取记录',
    'parent_id'   => $first_id_27,
    'router'      => 'admin/Coupon/coupon_log',
    'icon'        => 'layui-icon-tabs',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'Coupon',
    'action'      => 'coupon_log',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-normal',
    'is_show'     => 0
]);

$first_id_29 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券删除',
    'parent_id'   => $first_id_27,
    'router'      => 'admin/Coupon/delete',
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'Coupon',
    'action'      => 'delete',
    'create_time' => time(),
    'style'       => 'layui-btn-xs layui-btn-danger',
    'is_show'     => 0
]);

$first_id_30 = db('mg_menu')->insertGetId([
    'mg_module'   => $mg_module,
    'name'        => '优惠券领取记录',
    'parent_id'   => $first_id_21,
    'router'      => 'admin/Coupon/coupon_user',
    'icon'        => 'layui-icon-delete',
    'status'      => 1,
    'sort'        => 92,
    'module'      => $mg_module,
    'controller'  => 'Coupon',
    'action'      => 'coupon_user',
    'create_time' => time(),
    'style'       => 'layui-btn-xs',
    'is_show'     => 1
]);




